package org.com.FeignFallback;

import Entity.Community;
import lombok.extern.slf4j.Slf4j;
import org.com.FeignClient.CommunityFeign;
import org.springframework.http.ResponseEntity;
import org.springframework.stereotype.Component;

import java.util.ArrayList;
import java.util.List;

@Slf4j
@Component
public class CommunityFeignFallback implements CommunityFeign {
    @Override
    public List<Community> allblog() {
        log.info("community.list熔断处理");
        List<Community> list = new ArrayList<>();
        Community community = new Community();
        community.setTitle("熔断处理");
        community.setContent("熔断处理");
        list.add(community);
        return list;

    }

    @Override
    public ResponseEntity<Community> save(Community community) {
        log.info("community.save熔断处理");
        return ResponseEntity.ok(community);
    }

    @Override
    public boolean delete(Integer id) {
        log.info("community.delete熔断处理");
        return true;
    }
}
